Experience is learning from your mistakes
Wisdom is learning from other peoples mistakes
Alt-Shift-K also works (Option-shift-K on Mac)
Any line that starts with at least one “#” (making it a comment) and ends with at least 4 “=”, “-”, or “#” Becomes a Section Header
## I am a Section Header --------------
# So am I ====
##### Me Too! #####
Section Headers are used for:
(details on future slides)
Back and Next arrows will move within a file and between open tabs in the editor.
Code folding works on:
Look for triangles on the left, next to the row number.
You can also fold an arbitrary section (even just a section of a really long line) by highlighting the section then choosing Edit > Folding > Collapse.
Using the menu you can also “Fold All” or “Expand All”.
In R scripts we often run a block of code, make a few edits, then rerun that same block.
There is a button that makes this easier without having to re-select the block each time. It does not have any words, but is between the “Run” and “Source” buttons to the top right of the editor window.
If you want to copy between editing panes, or just compare 2 files side by side, you can pop out a pane.
Hold down the Alt key while selecting a region to make the selection rectangular for editing.